package com.ppafl;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;

public class PPAFLActivity extends Activity{
    /** Called when the activity is first created. */
	Button selectLeagueBtn;
	Spinner leaguesSprinner;
	Context context;
	Intent mainContentIntent;
	TextView text;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        context = this;
        leaguesSprinner = (Spinner) findViewById(R.id.leaguesMenu);
        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.leagues_array, 
android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        leaguesSprinner.setAdapter(adapter);
        leaguesSprinner.setOnItemSelectedListener(new LeagueSelected());
        text = (TextView) findViewById(R.id.textView1);
        
        selectLeagueBtn = (Button) findViewById(R.id.selectContinue);
        selectLeagueBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				mainContentIntent = new Intent(context, com.ppafl.MainContentActivity.class);
				startActivity(mainContentIntent);
				
			}
		});
    }
    

}